import request from '@/utils/request'

// 创建结算单
export function createAppFinalStatement(data) {
  return request({
    url: '/pekingfish/app-final-statement/create',
    method: 'post',
    data: data
  })
}

// 更新结算单
export function updateAppFinalStatement(data) {
  return request({
    url: '/pekingfish/app-final-statement/update',
    method: 'put',
    data: data
  })
}

export function updateStatus(id) {
  const data = {
    id
  }
  return request({
    url: '/pekingfish/app-final-statement/updateStatus',
    method: 'put',
    data: data
  })
}

// 删除结算单
export function deleteAppFinalStatement(id) {
  return request({
    url: '/pekingfish/app-final-statement/delete?id=' + id,
    method: 'delete'
  })
}

// 获得结算单
export function getAppFinalStatement(id) {
  return request({
    url: '/pekingfish/app-final-statement/get?id=' + id,
    method: 'get'
  })
}

// 获得结算单分页
export function getAppFinalStatementPage(query) {
  return request({
    url: '/pekingfish/app-final-statement/page',
    method: 'get',
    params: query
  })
}

// 导出结算单 Excel
export function exportAppFinalStatementExcel(query) {
  return request({
    url: '/pekingfish/app-final-statement/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
